Fix vif-net script for setups where eth0 has no IP address.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 2 Dec 2005 21:15:58 +0000 (22:15 +0100)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 2 Dec 2005 21:15:58 +0000 (22:15 +0100)
Use the IP address associated with the backend network interface
for connections from dom0 to the guest connected to this network
interface.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/examples/vif-nat

index b2bfade528bfecc3cb1220aed545193a815154ec..d667fb89da60f7c47d93790965a8d7821130d123 100644 (file)
@@ -91,8 +91,6 @@ vif_int=$(( $(echo "((($vif_ip" | sed -e 's#\.#)\*256\+#g') ))
 netmask=$(dotted_quad $intmask)
 network=$(dotted_quad $(( $vif_int & $intmask )) )
 
-main_ip=$(dom0_ip)
-
 
 dhcp_remove_entry()
 {
@@ -140,7 +138,7 @@ case "$command" in
 
         do_or_die ip link set "$vif" up arp on
         do_or_die ip addr add "$router_ip" dev "$vif"
-        do_or_die ip route add "$vif_ip" dev "$vif" src "$main_ip"
+        do_or_die ip route add "$vif_ip" dev "$vif" src "$router_ip"
         echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp
         [ "$dhcp" != 'no' ] && dhcp_up
         ;;